package org.hypnus.e.engine.config;

import java.util.HashMap;
import java.util.Map;


public class ServiceConfig {

	private String name ;
	
	private String extend ;
	
	private Map<String,ServiceNode> mapNode  ;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getExtend() {
		return extend;
	}

	public void setExtend(String extend) {
		this.extend = extend;
	}

	
	public void addNode(ServiceNode node) {
		if(mapNode==null){
			mapNode = new HashMap<String,ServiceNode>() ;
		}
		mapNode.put(node.getName(), node);
	}
	
	public ServiceNode getServiceNode(String key){
		ServiceNode tmp = mapNode.get(key) ;
		if(tmp==null){
			throw new IllegalArgumentException("not find the service node :"+key+" service name :"+this.name) ;
		}
		return tmp ;
	}
	
}
